<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增收租费用')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-expense-add">
            <input id="tenantId" name="tenantId" type="hidden">
<!------------------------------------------------------------基本信息---------------------------------------------------------->
            <h4 class="form-header h4">基本信息</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">楼栋：</label>
                    <div class="col-sm-8">
                        <div class="input-group">
                            <select id="building" class="form-control" required>
                                <option value="">--请选择楼栋--</option>
                                <option th:each="building:${building}" th:value="${building.buildingId}" th:text="${building.buildingName}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">单元号：</label>
                    <div class="col-sm-8">
                        <div class="input-group">
                            <select id="unit" class="form-control noselect2 selectpicker" data-none-selected-text="请选择单元" multiple>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">租户名称：</label>
                    <div class="col-sm-8">
                        <div class="input-group">
                            <select id="tenantName" class="form-control noselect2 selectpicker" data-none-selected-text="请选择租户">
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">单元用途：</label>
                    <div class="col-sm-8">
                        <label class="radio-box"> <input type="radio" name="tenantUse" id="live" value="0" disabled/> 宿舍 </label>
                        <label class="radio-box"> <input type="radio" name="tenantUse" id="store" value="1" disabled/> 个人 </label>
                        <label class="radio-box"> <input type="radio" name="tenantUse" id="office" value="2" disabled/> 企业 </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">面积：</label>
                    <div class="col-sm-8">
                        <input id="tenantArea" name="tenantArea" class="form-control" type="text" required readonly number>
                    </div>
                </div>
            </div>
            <input id="apportionRatio" name="apportionRatio" class="form-control" type="hidden">
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">公摊比例：</label>
                    <div class="col-sm-8">
                        <input id="apportionRatioTemp" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月应收租金：</label>
                    <div class="col-sm-8">
                        <input id="monthlyRentFee" name="monthlyRentFee" class="form-control" type="text" required readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月实收租金：</label>
                    <div class="col-sm-8">
                        <input id="realMonthlyRentFee" value="0" name="realMonthlyRentFee" class="form-control" type="text" required number>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月应收物业费：</label>
                    <div class="col-sm-8">
                        <input id="propertyFee" name="propertyFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月实收物业费：</label>
                    <div class="col-sm-8">
                        <input id="realPropertyFee" value="0" name="realPropertyFee" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">90%本月实收租金：</label>
                    <div class="col-sm-8">
                        <input id="ninetyPercentRealMonthlyFee" name="ninetyPercentRealMonthlyFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                </div>
            </div>
<!------------------------------------------------------------电费信息---------------------------------------------------------->
            <h4 class="form-header h4">电费信息</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">上月电表度数：</label>
                    <div class="col-sm-8">
                        <input id="lastMonthEletableNumber" value="0" name="lastMonthEletableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月电表度数：</label>
                    <div class="col-sm-8">
                        <input id="thisMonthEletableNumber" value="0" name="thisMonthEletableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月用电度数：</label>
                    <div class="col-sm-8">
                        <input id="useElectricNumber" value="0" name="useElectricNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">电公摊基数：</label>
                    <div class="col-sm-8">
                        <input id="electricApportionBaseNumber" value="0" name="electricApportionBaseNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊电度数：</label>
                    <div class="col-sm-8">
                        <input id="apportionElectricNumber" value="0" name="apportionElectricNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">总用电数：</label>
                    <div class="col-sm-8">
                        <input id="totalElectricNumber" value="0" name="totalElectricNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">电费单价：</label>
                    <div class="col-sm-8">
                        <input id="electricUninPrice" value="0" name="electricUninPrice" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">自用电费：</label>
                    <div class="col-sm-8">
                        <input id="useElectricFee" value="0" name="useElectricFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊电费：</label>
                    <div class="col-sm-8">
                        <input id="apportionElectricFee" value="0" name="apportionElectricFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                </div>
            </div>
<!------------------------------------------------------------水费信息---------------------------------------------------------->
            <h4 class="form-header h4">水费信息</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">上月水表度数：</label>
                    <div class="col-sm-8">
                        <input id="lastMonthWatableNumber" value="0" name="lastMonthWatableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月水表度数：</label>
                    <div class="col-sm-8">
                        <input id="thisMonthWatableNumber" value="0" name="thisMonthWatableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月用水度数：</label>
                    <div class="col-sm-8">
                        <input id="useWaterNumber" value="0" name="useWaterNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">水公摊基数：</label>
                    <div class="col-sm-8">
                        <input id="waterApportionBaseNumber" value="0" name="waterApportionBaseNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊水度数：</label>
                    <div class="col-sm-8">
                        <input id="apportionWaterNumber" value="0" name="apportionWaterNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">总用水数：</label>
                    <div class="col-sm-8">
                        <input id="totalWaterNumber" value="0" name="totalWaterNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">水费单价：</label>
                    <div class="col-sm-8">
                        <input id="waterUninPrice" value="0" name="waterUninPrice" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">自用水费：</label>
                    <div class="col-sm-8">
                        <input id="useWaterFee" value="0" name="useWaterFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊水费：</label>
                    <div class="col-sm-8">
                        <input id="apportionWaterFee" value="0" name="apportionWaterFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                </div>
            </div>

            <h4 class="form-header h4">收费合计</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">自用水电费用合计：</label>
                    <div class="col-sm-8">
                        <input id="useTotalUtilityFee" value="0" name="useTotalUtilityFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊水电费用合计：</label>
                    <div class="col-sm-8">
                        <input id="apportionTotalUtilityFee" value="0" name="apportionTotalUtilityFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">水电费用合计：</label>
                    <div class="col-sm-8">
                        <input id="totalUtilityFee" value="0" name="totalUtilityFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">宽带费用：</label>
                    <div class="col-sm-8">
                        <input id="wlanFee" value="0" name="wlanFee" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月实收金额：</label>
                    <div class="col-sm-8">
                        <input id="totalMonthRealFee" value="0" name="totalMonthRealFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <th:block th:include="include :: expense-add-js" />

    <script type="text/javascript">
        var apportionRatioOver = 0;

        var prefix = ctx + "system/expense"
        $("#form-expense-add").validate({
            focusCleanup: true
        });

        // ------------------------------------------------------------------提交事件JS-------------------------------------------------------------
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-expense-add').serialize());
            }
        };

        // --------------------------------------------------------------------渲染-----------------------------------------------------------------
        $('#unit').selectpicker({
            'width':'300px'
        });

        $('#tenantName').selectpicker({
            'width':'300px'
        });

        $(function() {
            $('#building').select2({
                placeholder: "请选择楼栋",
                allowClear: true
            });
        });
    </script>
</body>
</html>